package com.sino.dataworks.config;

import com.sino.dataworks.job.DataworksInstanceLog;
import org.quartz.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class DataWorksInstanceLogConfig {
        //指定具体的定时任务类
//        @Bean
//        public JobDetail uploadInstanceLogTaskDetail() {
//            return JobBuilder.newJob(DataworksInstanceLog.class)
//                    .withIdentity("dataworksInstanceLog")
//                    .storeDurably().build();
//        }
//
//        @Bean
//        public Trigger uploadInstanceLogTaskTrigger() {
//            //这里设定触发执行的方式
//            //0 10 7 * * ? 每天7点10分执行
//            CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule("0 10 7 * * ?");
//            // 返回任务触发器
//            return TriggerBuilder.newTrigger().forJob(uploadInstanceLogTaskDetail())
//                    .withIdentity("dataworksInstanceLog")
//                    .withSchedule(scheduleBuilder)
//                    .build();
//        }
}
